package com.teen9g.infoplatformserver.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.teen9g.dto.TeachingBuildingDTO;
import com.teen9g.entity.TeachingBuilding;
import com.teen9g.userVO.TeachingBuildingUserVO;
import org.codehaus.jettison.json.JSONException;

public interface TeachingBuildingService extends IService<TeachingBuilding> {
    /**
     * 添加教学楼信息
     *
     * @param teachingBuildingDTO 教学楼信息DTO
     * @return 添加结果
     */
    int add(TeachingBuildingDTO teachingBuildingDTO);

    /**
     * 根据id获取教学楼信息
     *
     * @param id 教学楼信息id
     * @return 教学楼信息
     */
    TeachingBuilding getById(Integer id);


    /**
     * 更新教学楼信息
     *
     * @param teachingBuildingDTO 教学楼信息DTO
     * @param id                  修改的教学楼信息id
     * @return 修改结果
     */
    int update(TeachingBuildingDTO teachingBuildingDTO, Integer id) throws JSONException;

    /**
     * 根据id删除教学楼信息
     *
     * @param id 教学楼信息id
     * @return 删除结果
     */
    int delete(Integer id);

    /**
     * 分页查询教学楼信息
     *
     * @param pageNum  页码
     * @param pageSize 每页大小
     * @return 分页结果
     */
    PageInfo<TeachingBuilding> getpage(Integer pageNum, Integer pageSize, Integer buildingId, String roomNumber);

    void addView(Integer id);

    PageInfo<TeachingBuildingUserVO> getpageUser(Integer pageNum, Integer pageSize, String contentAuthor);
}
